/**
 * 
 */
package com.bocai;


/**
 * 所有服务接口可能抛出的异常。接口服务类不允许抛出其他类型的异常。
 * 
 * @author evan.wu
 *
 */
public class ApiException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3589826180480862147L;
	private int responseCode;

	public ApiException(int responseCode, String message, Exception cause) {
		super(message, cause);
		this.responseCode = responseCode;
	}
	
	public ApiException(int responseCode, String message) {
		super(message);
		this.responseCode = responseCode;
	}
	
	public ApiException(int responseCode) {
		this.responseCode = responseCode;
	}
	
	public int getResponseCode() {
		return responseCode;
	}
	
	public String toString() {
		return responseCode + ": " + super.toString();
	}
}
